#include<sqlite3.h>
#include<stdio.h>
//-lsqlite3

int main()
{
    sqlite3 *db;
    int ret = sqlite3_open("test.db",&db);
    if(ret!=SQLITE_OK)
    {
        printf("open error:%s\n",sqlite3_errmsg(db));
    }

    char sql[400];
    int id,score;
    char name[20]={0};
    // scanf("%d %s %d",&id,name,&score);
    // sprintf(sql,"insert into stu values(%d,'%s',%d);",id,name,score);
    scanf("%d %s",&score,name);
    sprintf(sql,"update stu set score=%d where name='%s';",score,name);
    // scanf("%s",name);
    // sprintf(sql,"delete from stu where name='%s';",name);
    if(sqlite3_exec(db,sql,NULL,NULL,NULL)!=SQLITE_OK)
    {
        printf("exec error:%s\n",sqlite3_errmsg(db));
    }
    
    sqlite3_close(db);
    return 0;
}